#include <iostream>
#include <cstdio>
#include <cmath>
#include <queue>
#include <vector>
#include <cstring>
#define MAXN 2333
using namespace std;

queue < int > lk;
vector < int > t[MAXN], w[MAXN];
double f[MAXN];
int n, m, a, b;
bool fl[MAXN];

inline int read() {
	int k = 0;char c = getchar();
	for(;!isdigit(c); c = getchar());
	for(; isdigit(c); c = getchar())k = k * 10 + c - '0';
	return k;
}

void spfa(int a) {
	lk.push(a);
	fl[a] = 1;
	memset(f, 0x7f, sizeof(f));
	f[a] = 100.0;
	while(!lk.empty()) {
		int x = lk.front();
		lk.pop();
		fl[x] = 0;
		int l = t[x].size();
		for(int i = 0; i < l; i++) {
			int y = t[x][i];
			int z = w[x][i];
			if(f[y] >= (f[x] * 100 / (100 - z))) {
				f[y] = (f[x] * 100 / (100 - z)) ;
				if(fl[y])continue;
				fl[y] = 1;
				lk.push(y);
			}
		} 
	}
}

int main() {
	
	n = read();
	m = read();
	
	for(int i = 1; i <= m; i++) {
		int x = read();
		int y = read();
		int z = read();
		t[x].push_back(y);
		t[y].push_back(x);
		w[x].push_back(z);
		w[y].push_back(z);
	}
	
	a = read();
	b = read();
	
	spfa(b);
	
	printf("%.8lf", f[a]);
	return 0;
}
